"""URL configuration for cmdb project."""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from assets import auth_views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include('assets.urls')),
    path('api/auth/register/', auth_views.register, name='register'),
    path('api/auth/login/', auth_views.login, name='login'),
    path('api/auth/logout/', auth_views.logout, name='logout'),
    path('api/auth/current-user/', auth_views.current_user, name='current-user'),
    path('api/auth/update-profile/', auth_views.update_profile, name='update-profile'),
    path('api/auth/upload-avatar/', auth_views.upload_avatar, name='upload-avatar'),
    path('api/auth/change-password/', auth_views.change_password, name='change-password'),
]

# 添加媒体文件URL配置
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
